// @battle
// 战斗相关的接口
const express = require('express');
const router = express.Router();
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const gravatar = require('gravatar');
const keys = require('../../config/keys');
const passport = require('passport');

const User = require('../../models/User/User');
const Maps = require('../../models/Map');
const open_api = require('../../controller/open_api');
const battle_api = require('../../controller/battle_api');

// @route  GET api/users/test
// @desc   返回的请求的json数据
// @access public
router.get('/test', (req, res) => {
    res.json({ msg: 'login works' });
  });
  

// @route  Post /battles/player/:id
// @desc   玩家、npc 战斗接口
// @access Private
router.post('/player/:id', passport.authenticate('jwt', { session: false }), battle_api.playerbattle);

module.exports = router;